﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace KingSite.Library.Log.Log4netWrapper {
    public class Log4netWrapper : ILog {
        public void AddLog(string msg) {
            AddLog(msg, DateTime.Now);
        }

        public void AddLog(string msg, DateTime time) {
            //创建日志记录组件实例
            log4net.ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            //记录错误日志
            log.Info(msg);
        }
    }
}
